package com.neuedu.boot.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.PropertySource;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
 * @author 金山
 * 项目：boot-learn
 * site: https://blog.fulfill.com.cn
 * 描述
 * @data 2025/3/2011:23
 */
@RestController


public class ReadValueController {

    @Value("${spring.datasource.username}")
    private String username;

    @Value("${spring.datasource.password}")
    private String password;

    @Value("${spring.datasource.url}")
    private String url;

    @Value("${spring.datasource.driver-class-name}")
    private String driverClass;
    @Value("${server.port:9090}")
    private String port;

    @Value("${a}")
    private String a;

    /**
     * http://localhost:8080/readValue
     * @return
     */
    @RequestMapping("/readValue")
    Map readValue(){
        Map info = new HashMap();
        info.put("username",username);
        info.put("password",password);
        info.put("url",url);
        info.put("driverClass",driverClass);
        info.put("server.port",port);
        info.put("a",a);

        return info;
    }



}
